module.exports = class extends think.Model {
  getList() {
    return this.select();
  }

  async updateFileStatus(data) {
    await this.where({ id: data.fileitemId }).update({
      status: data.status
    });
  }

  async addFile(filename) {
    try {
      const file = await this.add({
        filename: filename + think.uuid()
      });
      return file;
    } catch (error) {
      think.logger.debug(error);
    }
  }
};
